package com.kksoft.android.xiaoliaobaike.model;

import java.util.HashMap;
import java.util.Map;

import net.tsz.afinal.annotation.sqlite.Id;
import net.tsz.afinal.annotation.sqlite.Table;

@Table(name = "article")
public class Article {

	@Id
	Integer id;

	String title;
	Integer seriesId;

	Integer articleId;
	String articleUrl;

	String originalUrl;
	String thumbUrl;
	String pubDate;

	int mark = 0; // 收藏
	int markOrder = 0; // 收藏顺序

	public Article() {
	}

	public Article(Integer id, String title, Integer seriesId, Integer articleId, String articleUrl, String originalUrl, String thumbUrl, String pubDate, int mark, int markOrder) {
		super();
		this.id = id;
		this.title = title;
		this.seriesId = seriesId;
		this.articleId = articleId;
		this.articleUrl = articleUrl;
		this.originalUrl = originalUrl;
		this.thumbUrl = thumbUrl;
		this.pubDate = pubDate;
		this.mark = mark;
		this.markOrder = markOrder;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public Integer getSeriesId() {
		return seriesId;
	}

	public void setSeriesId(Integer seriesId) {
		this.seriesId = seriesId;
	}

	public Integer getArticleId() {
		return articleId;
	}

	public void setArticleId(Integer articleId) {
		this.articleId = articleId;
	}

	public String getArticleUrl() {
		return articleUrl;
	}

	public void setArticleUrl(String articleUrl) {
		this.articleUrl = articleUrl;
	}

	public String getOriginalUrl() {
		return originalUrl;
	}

	public void setOriginalUrl(String originalUrl) {
		this.originalUrl = originalUrl;
	}

	public String getThumbUrl() {
		return thumbUrl;
	}

	public void setThumbUrl(String thumbUrl) {
		this.thumbUrl = thumbUrl;
	}

	public String getPubDate() {
		return pubDate;
	}

	public void setPubDate(String pubDate) {
		this.pubDate = pubDate;
	}

	public int getMark() {
		return mark;
	}

	public void setMark(int mark) {
		this.mark = mark;
	}

	public int getMarkOrder() {
		return markOrder;
	}

	public void setMarkOrder(int markOrder) {
		this.markOrder = markOrder;
	}

	@Override
	public String toString() {
		return "Article [id=" + id + ", title=" + title + ", seriesId=" + seriesId + ", articleId=" + articleId + ", articleUrl=" + articleUrl + ", originalUrl=" + originalUrl + ", thumbUrl=" + thumbUrl + ", pubDate=" + pubDate + ", mark=" + mark + ", markOrder=" + markOrder + "]";
	}

	public Map<String, Object> toMap() {
		Map<String, Object> map = new HashMap<String, Object>();

		map.put("id", id);
		map.put("title", title);
		map.put("seriesId", seriesId);
		map.put("articleId", articleId);
		map.put("articleUrl", articleUrl);
		map.put("originalUrl", originalUrl);
		map.put("thumbUrl", thumbUrl);
		map.put("pubDate", pubDate);
		map.put("mark", mark);
		map.put("markOrder", markOrder);

		return map;
	}
}